package com.magold.sound;

import org.andengine.engine.handler.timer.ITimerCallback;
import org.andengine.engine.handler.timer.TimerHandler;
import org.andengine.entity.IEntity;

public class ScheduledNoise extends DefaultNoiseMaker implements ITimerCallback {
	private final float mTimerGap;
	
	public ScheduledNoise(float pTimerGap, float pRange, IEntity pMakerEntity, String pSoundPath) {
		super(pRange, pMakerEntity, pSoundPath);
		mTimerGap = pTimerGap;
	}

	@Override
	public void onTimePassed(TimerHandler pTimerHandler) {
		play();
	}
	
	public TimerHandler createTimer() {
		TimerHandler timer = new TimerHandler(mTimerGap, true, this);
		return timer;
	}
}
